﻿@{
	string FlowID = Request.QueryString["flowid"];
	string StepID = Request.QueryString["stepid"];
	string GroupID = Request.QueryString["groupid"];
	string TaskID = Request.QueryString["taskid"];
	string InstanceID = Request.QueryString["instanceid"];
	string DisplayModel = Request.QueryString["display"] ?? "0";
	string IsMobile = Request.QueryString["ismobile"] ?? "0";
	string DBConnID = "06075250-30dc-4d32-bf97-e922cb30fac8";
	string DBTable = "OaPresentation";
	string DBTablePK = "ID";
	string DBTableTitle = "Title";
	if(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString["instanceid1"];}
	RoadFlow.Platform.Dictionary BDictionary = new RoadFlow.Platform.Dictionary();
	RoadFlow.Platform.WorkFlow BWorkFlow = new RoadFlow.Platform.WorkFlow();
	RoadFlow.Platform.WorkFlowTask BWorkFlowTask = new RoadFlow.Platform.WorkFlowTask();
	string fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);
	LitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus, "{\"oapresentation.sendtime\":\"yyyy年MM月dd日 HH时mm分\",\"oapresentation.time\":\"yyyy-MM-dd\"}");
	string TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);
}
<link href="~/Scripts/FlowRun/Forms/flowform.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/FlowRun/Forms/common.js" type="text/javascript" ></script>
<link href="~/Content/Theme/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/bootstrap.min.js" type="text/javascript" ></script>
<input type="hidden" id="Form_ValidateAlertType" name="Form_ValidateAlertType" value="1" />
<input type="hidden" id="OaPresentation.Title" name="OaPresentation.Title" value="@(TaskTitle.IsNullOrEmpty() ? BWorkFlow.GetAutoTaskTitle(FlowID, StepID, Request.QueryString["groupid"],TaskID) : TaskTitle)" />
<input type="hidden" id="Form_TitleField" name="Form_TitleField" value="OaPresentation.Title" />
<input type="hidden" id="Form_DBConnID" name="Form_DBConnID" value="06075250-30dc-4d32-bf97-e922cb30fac8" />
<input type="hidden" id="Form_DBTable" name="Form_DBTable" value="OaPresentation" />
<input type="hidden" id="Form_DBTablePk" name="Form_DBTablePk" value="ID" />
<input type="hidden" id="Form_DBTableTitle" name="Form_DBTableTitle" value="Title" />
<input type="hidden" id="Form_AutoSaveData" name="Form_AutoSaveData" value="1" />
<script type="text/javascript">
	var initData = @Html.Raw(BWorkFlow.GetFormDataJsonString(initData));
	var fieldStatus = "1"=="@Request.QueryString["isreadonly"]" ? {} : @Html.Raw(fieldStatus);
	var displayModel = '@DisplayModel';
	var ismobile = '@IsMobile';
	$(window).load(function (){
		formrun.initData(initData, "OaPresentation", fieldStatus, displayModel);
	});
</script>
<p><br/></p><style></style><script type="text/javascript">function getCliname()
{
  var id=document.getElementById("OaPresentation.ProjectID").value;
   $.ajax({
        url: '/PlatformApi/OaProject/GetProjectDetailByID?id='+id,
        type: 'Get',
        //返回值类型 一般设置为json
        dataType:"json",
        success: function (data) //服务器成功响应处理函数
        {             
              if(data.status==1){
                 document.getElementById("OaPresentation.ClientID_text").value=data.clientname;
                 document.getElementById("OaPresentation.ClientID").value=data.clientid;
              }  
              else{
              alert(data.msg);
              } 
        },
        error: function(XMLHttpRequest, textStatus, errorThrown){
            //请求出错处理
            alert("获取客户信息失败");
        } 

   });
}
//获取日报类型；项目日报或者是日报，若是项目日报则进行onchange事件
function change(){
  var radios = document.getElementsByName("OaPresentation.DailyType");

  for ( var i = 0; i < radios.length; i++) {

  if (radios[1].checked==true) {
    //radios.onclick();
    changestype(0);
    
    //i++;
    //alert("你选中的是第"+i+"个单选框。值为："+radios[--i].value);

  }

  }
}
$(window).load(function() {
     change();
});
function changestype(y){

  if (y==0) {
     document.getElementById("a").style.display = "none";
     document.getElementById("b").style.display = "none";
   }
  else {
     document.getElementById("a").style.display = "";
     document.getElementById("b").style.display = "";
   }

  if (y==1) {
    document.getElementById("c").style.display = "none";
    document.getElementById("d").style.display = "none";
    document.getElementById("e").style.display = "none";
    //清空选择的项目名称和客户名称
    document.getElementById("OaPresentation.ProjectID_text").value = "";
    document.getElementById("OaPresentation.ProjectID").value = "";
    document.getElementById("OaPresentation.ClientID_text").value = "";
    document.getElementById("OaPresentation.ClientID").value = "";
    document.getElementById("OaPresentation.WorkType").options[0].selected = true;
    document.getElementById("OaPresentation.Workload").options[0].selected = true;
    document.getElementById("OaPresentation.AuditLoad").options[0].selected = true;
   }
  else {
    document.getElementById("c").style.display = "";
    document.getElementById("d").style.display = "";
    document.getElementById("e").style.display = "";
   }

}</script><table class="flowformtable tableF table table-bordered" data-sort="sortDisabled" width="100%" cellspacing="1" cellpadding="0" align="center"><tbody><tr class="firstRow"><th rowspan="1" colspan="2" valign="middle" align="center"><span class="title">日报</span></th></tr><tr><th class="titleT" rowspan="1" colspan="2" valign="middle" align="center"><br/></th></tr><tr><td class="Tradio top" rowspan="1" colspan="1" valign="top"><p class="txt">日报类型</p><input name="OaPresentation.DailyType" id="OaPresentation.DailyType_0" value="1" checked="checked" style="vertical-align:middle;" isflow="1" type1="flow_radio" onclick="onclick_a1e6282abc7129fcdabcbe0b29d086b5(this);" type="radio"/><label for="OaPresentation.DailyType_0" style="vertical-align:middle;margin-right:3px;">工作日报</label><input name="OaPresentation.DailyType" id="OaPresentation.DailyType_1" value="0" style="vertical-align:middle;" isflow="1" type1="flow_radio" onclick="onclick_a1e6282abc7129fcdabcbe0b29d086b5(this);" type="radio"/><label for="OaPresentation.DailyType_1" style="vertical-align:middle;margin-right:3px;">项目日报</label><script type="text/javascript">function onclick_a1e6282abc7129fcdabcbe0b29d086b5(srcObj){var y = $('input[name="OaPresentation.DailyType"]:checked').val();
changestype(y);
changes()
  }</script></td><td class="top" rowspan="1" colspan="1" valign="top"><p class="txt">发送时间</p><input type1="flow_datetime" id="OaPresentation.SendTime" name="OaPresentation.SendTime" value="@(RoadFlow.Utility.DateTimeNew.ShortDateTime)" format="yyyy年MM月dd日 HH时mm分" defaultvalue="%40(RoadFlow.Utility.DateTimeNew.ShortDateTime)" istime="0" daybefor="0" dayafter="0" currentmonth="0" isflow="1" class="mycalendar" title="" type="text"/></td></tr><tr><td rowspan="1" colspan="1" valign="top"><p class="txt">接收人</p><input type1="flow_org" id="OaPresentation.Receive" name="OaPresentation.Receive" value="" style="width:55%" more="1" isflow="1" class="mymember" title="" dept="0" station="0" user="1" workgroup="0" unit="0" rootid="" type="text"/></td><td><br/></td></tr><tr><td rowspan="1" colspan="2" valign="top"><p class="txt">工作内容</p><textarea isflow="1" type1="flow_textarea" id="OaPresentation.Summary" name="OaPresentation.Summary" class="mytext" style="height:60px"></textarea></td></tr><tr id="a"><td rowspan="1" colspan="2" valign="top"><p class="txt">明日计划</p><textarea isflow="1" type1="flow_textarea" id="OaPresentation.Programme" name="OaPresentation.Programme" class="mytext" style="height:60px"></textarea></td></tr><tr id="b"><td rowspan="1" colspan="1" class="bottom" valign="top"><p class="txt">附件</p><input type1="flow_files" id="OaPresentation.Files" name="OaPresentation.Files" value="" style="width:55%" filetype="*.jpg;*.png;*.gif;*.doc;*.docx" isflow="1" class="myfile" title="" type="text"/></td><td rowspan="1" colspan="1" class="bottom" valign="top"><p class="txt">备注</p><textarea isflow="1" type1="flow_textarea" id="OaPresentation.Remark" name="OaPresentation.Remark" class="mytext" style="height:25px !important;width:240px !important;"></textarea></td></tr><tr id="c" style="display:none"><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">工作日期</p><input type1="flow_datetime" id="OaPresentation.Time" name="OaPresentation.Time" value="" format="yyyy-MM-dd" defaultvalue="" istime="0" daybefor="0" dayafter="0" currentmonth="0" isflow="1" class="mycalendar" title="" type="text"/></td><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">工作类型</p><select class="myselect" id="OaPresentation.WorkType" name="OaPresentation.WorkType" isflow="1" type1="flow_select"><option value=""></option>@Html.Raw(BDictionary.GetOptionsByID("e7a16e9a-5354-4df5-9ae7-110d267c9f36".ToGuid(), RoadFlow.Platform.Dictionary.OptionValueField.Value, "", false))</select></td></tr><tr id="d" style="display:none"><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">项目名称</p><input id="OaPresentation.ProjectID" type1="flow_selectdiv" name="OaPresentation.ProjectID" value="" style="width:55%" appid="1e499b93-ecc3-4f53-95ae-eeca0510a2ba" titlefield="项目名称" pkfield="ID" paramsvalue="" paramsname="" isflow="1" class="myselectdiv" title="" onchange="onchange_cbdfa33020d68261961da01ff801fb39 (this);" type="text"/><script type="text/javascript">function onchange_cbdfa33020d68261961da01ff801fb39(srcObj){getCliname();}</script></td><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">客户名称</p><input id="OaPresentation.ClientID" type1="flow_selectdiv" name="OaPresentation.ClientID" value="" appid="a69b83b2-69e6-4ede-83c4-d4f4592c421c" titlefield="name" pkfield="id" paramsvalue="" paramsname="" style="width:55%" isflow="1" class="myselectdiv" title="" type="text"/></td></tr><tr id="e" style="display:none" class="bottom"><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">工作量</p><select class="myselect" id="OaPresentation.Workload" name="OaPresentation.Workload" isflow="1" type1="flow_select"><option value=" " selected="selected"></option><option value="0.00">0.0</option><option value="0.10">0.1</option><option value="0.25">0.25</option><option value="0.50">0.5</option><option value="0.75">0.75</option><option value="1.00">1</option></select></td><td rowspan="1" colspan="1" class="bottom" valign="top"><p class="txt">审核工作量</p><select class="myselect" id="OaPresentation.AuditLoad" name="OaPresentation.AuditLoad" isflow="1" type1="flow_select"><option value=" " selected="selected"></option><option value="0.00">0.0</option><option value="0.10">0.1</option><option value="0.25">0.25</option><option value="0.50">0.5</option><option value="0.75">0.75</option><option value="1.00">1</option></select></td></tr><tr style="display:none" class="bottom"><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">发送人</p><input type1="flow_org" id="OaPresentation.Send" name="OaPresentation.Send" value="u_@RoadFlow.Platform.Users.CurrentUserID.ToString()" style="width:55%" more="1" isflow="1" class="mymember" title="" dept="0" station="0" user="1" workgroup="0" unit="0" rootid="" type="text"/></td><td style="display:none" class="bottom" rowspan="1" colspan="1" valign="top"><p class="txt"> </p></td></tr></tbody></table>